package ru.mirent.app.entity;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Account {
    int balance;

    public Account(int balance) {
        this.balance = balance;
        System.out.println("[Account.java] Создан экземпляр класса Account");
    }

    public boolean withdraw(int amount) {
        System.out.println("[Account.java] Вызван метод withdraw со значением параметра amount: " + amount);
        if (balance < amount) {
            return false;
        }
        balance = balance - amount;
        return true;
    }
}
